-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Upgrade react-router-dom and use-query-params to latest in /ui #4764
chore: Upgrade react-router-dom and use-query-params to latest in /ui #4764
Conversation
- hacks/RouteAdapter is no longer needed, the TypeScript types are nowadays correct - Pass `to` directly to `useHref` to avoid errors with search params (see feast-dev#3794) Signed-off-by: Harri Lehtola <[email protected]>
Updating query params when filtering table views somehow stopped working after upgrading react-router-dom, upgrading use-query-params too fixes that. Signed-off-by: Harri Lehtola <[email protected]>
react-router-dom was writing warning messages in the console about upcoming features in v7 and suggested opting in early. I tried turning them on, but couldn't get custom tabs navigation working properly with v7_relativeSplatPath enabled, so decided to keep it off for now. (Plus it might also break something in consuming apps.) v7_startTransition only needed an update in one place in a test where we need to await for the UI to update, so kept it on. It also shouldn't require any changes in consuming application code, though possibly something in tests like we needed here. Related docs: - https://reactrouter.com/en/6.28.0/upgrading/future#v7_relativesplatpath - https://reactrouter.com/en/6.28.0/upgrading/future#v7_starttransition Signed-off-by: Harri Lehtola <[email protected]>
@@ -39,7 +39,7 @@ export default function EuiCustomLink({ to, ...rest }) { | |||
} | |||
|
|||
// Generate the correct link href (with basename accounted for) | |||
const href = useHref({ pathname: to }); | |||
const href = useHref(to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from react-router-dom's Link component: https://github.com/remix-run/react-router/blob/dd323b6dec531811ce80595ac0521455b46f0bc2/packages/react-router-dom/index.tsx#L999.
Do we need a label from someone to run the last check, build-docker-image-java (feature-server-java)? |
Could we get an |
A friendly reminder: could someone add a required label to this PR to run the pending check? 🙏 |
Thanks @franciscojavierarceo! |
What this PR does / why we need it:
Upgrades react-router-dom and use-query-params to their latest versions; the latter is upgraded because its older version didn't work properly with the latest react-router-dom.
One small change in EuiCustomLink is done to avoid the error reported in #3794, I tried clicking everywhere in the UI and didn't see the error after the change.
Which issue(s) this PR fixes:
This allows to use the latest react-router-dom in a consuming app in case someone is using it, no longer being restricted to <6.4.0 due to #3794.
Misc
After the upgrade, react-router-dom writes a warning console message like this:
I tried enabling the flag but it caused issues with our current custom tab routes, and I couldn't sort it out with reasonable effort at this point. Also, since the feature can require non-trivial changes, enabling it might break something in consuming apps that use react-router-dom, so maybe better to leave it later anyway.
I enabled another future flag that I saw a similar console warning about,
v7_startTransition
, since that seems much safer, though I did need to add oneawait
in the tests after that.